package org.zsl.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.zsl.model.User;
import org.zsl.service.UserService;


@RestController
@RequestMapping("/user")
@CrossOrigin
public class LoginController {

    private UserService service=new UserService();

   @PostMapping("/login")
    public String login(User user){

        return   JSON.toJSONString(service.login(user));
    }

}
